home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / The Hacks! / Transport Independent Speech / SpokenSerialApp / SpeechCallbacks.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-16  |  1.3 KB  |  58 lines  |  [TEXT/CWIE]

  1. #ifndef __SPEACHCALLBACKS__
  2. #include "SpeechCallbacks.h"
  3. #endif
  4.  
  5. OSErr        SetSpeechDoneCallback    (const SpeechChannel theSpeechChan)
  6. {
  7.     OSErr        theErr        = noErr;
  8.  
  9.     theErr = SetSpeechInfo (theSpeechChan, soSpeechDoneCallBack, NewSpeechDoneProc (SpeechDoneCallback));
  10.     if (theErr != noErr) {
  11.         DebugStr ("\pSetSpeechInfo (SetSpeechDoneCallback) error");
  12.     }
  13.  
  14.     return theErr;
  15. }
  16.  
  17. OSErr        SetWordCallback            (const SpeechChannel theSpeechChan)
  18. {
  19.     OSErr        theErr        = noErr;
  20.  
  21.     theErr = SetSpeechInfo (theSpeechChan, soWordCallBack, NewSpeechWordProc (WordCallback));
  22.     if (theErr != noErr) {
  23.         DebugStr ("\pSetSpeechInfo (SetWordCallback) error");
  24.     }
  25.  
  26.     return theErr;
  27. }
  28.  
  29. pascal void SpeechDoneCallback        (const SpeechChannel theSpeechChan,
  30.                                     const long refCon)
  31. {
  32. #pragma unused (theSpeechChan)
  33.  
  34.     if (refCon == 'test') {
  35. //        DebugStr ("\pEntering MySpeechDoneCallback, all is good.");
  36.     }
  37.     else {
  38.         DebugStr ("\pEntering MySpeechDoneCallback, all is NOT good.");
  39.     }    
  40. }
  41.  
  42. pascal void WordCallback            (const SpeechChannel theSpeechChan,
  43.                                     const long refCon,
  44.                                     const long wordPos,
  45.                                     const short wordLen)
  46. {
  47. #pragma unused (theSpeechChan)
  48. #pragma unused (wordPos)
  49. #pragma unused (wordLen)
  50.  
  51.     if (refCon == 'test') {
  52. //        DebugStr ("\pEntering MyWordCallback, all is good.");
  53.     }
  54.     else {
  55.         DebugStr ("\pEntering MyWordCallback, all is NOT good.");
  56.     }    
  57. }
  58.